From: Matthias Clasen Date: Sun, 14 May 2023 23:14:58 +0000 (-0400) Subject: wayland: Try harder to be compatible X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~59^2^2~259^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=89d993b6ecb30c76df9b948b80444c871b20a253;p=gtk4.git wayland: Try harder to be compatible We can keep the old unexport_handle api working in the case that there is only a single exported handle. --- diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c index efeb857b21..efe9ef86ce 100644 --- a/gdk/wayland/gdktoplevel-wayland.c +++ b/gdk/wayland/gdktoplevel-wayland.c @@ -2557,6 +2557,20 @@ gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel, void gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel) { + GdkWaylandToplevel *wayland_toplevel = GDK_WAYLAND_TOPLEVEL (toplevel); + + if (wayland_toplevel->exported != NULL && + wayland_toplevel->exported->next == NULL) + { + GdkWaylandExported *exported = wayland_toplevel->exported->data; + + if (exported->handle) + { + gdk_toplevel_unexport_handle (toplevel, exported->handle); + return; + } + } + g_warning ("Use gdk_wayland_toplevel_drop_exported_handle()"); }